<h1 class="title">Users</h1>

<table class="tabular">
 <tr class="header">
  <th>Username</th>
  <th>Email</th>
  <th>First name</th>
  <th>Last name</th>
  <th>Rights</th>
  <th>Actions</th>
 </tr>
<% odd = 1 %> 
<% for user in @users %>
 <tr <% if odd == 1 %>class="odd_row"<% odd = 0%><% else %>class="even_row"<% odd = 1 %><% end %>>
  <td><%= link_to user.username, { :controller => "user", :action => "show", :id => user.user_id } %></td>
  <td><%= user.email %></td>
  <td><%= user.first_name %></td>
  <td><%= user.last_name %></td>
  <td><%= user.rights %></td>
  <td>
   <% if session[:user].rights == 'ManageAll' %><%= link_to "Edit", { :controller => "user", :action => "edit", :id => user.user_id } %> |<% end %> 
   <% if session[:user].rights != 'ManageTasks' %><%= link_to "Projects", { :controller => "user", :action => "projects", :id => user.user_id } %><% end %>
  </td>
 </tr>
<% end %>
